package cn.e2win.biz.zdzx;

import java.sql.SQLException;
import java.util.Map;

import org.springframework.stereotype.Repository;

import cn.e2win.base.entity.BaseEntity;
import cn.e2win.base.json.vo.Pager;
import cn.e2win.biz.base.BaseDAOHibernateImpl;
import cn.e2win.biz.dbo.ZdzxEmp;


@Repository
public class ZdzxDaoImpl extends BaseDAOHibernateImpl implements ZdzxDao {

	String entitySql_ZdzxEmp =  "SELECT t.* FROM(SELECT t0.* FROM zdzx_emp t0) t WHERE 1=1";
	
	
	@Override
	public void pagerZdzxEmp(Pager pager) {
		try {
			pager.processSql(entitySql_ZdzxEmp + Pager.DEF_ORDER_BY);
			processPager(pager);
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

	@Override
	public Map<String, Object>getEntity(BaseEntity entity){
		String sql = null;
		if(entity instanceof ZdzxEmp){
			sql = entitySql_ZdzxEmp;
		}
		if(sql!=null){
			return super.get1stRecordBySql(sql + " AND id=" + entity.getId(), null);
		}
		return null;
	}

}
